﻿#ifndef THETIMINGWIDGET_H
#define THETIMINGWIDGET_H

#include <QWidget>
#include <QHBoxLayout>
#include <QLabel>
#include <QTimer>

class TheTimingWidget : public QWidget
{
    Q_OBJECT
public:
    explicit TheTimingWidget(QWidget *parent = nullptr);
    ~TheTimingWidget();

public:

    int GetSumTime( void ) const;

private:
    void InitUi( void );
    void InitProperty( void );

    void UpdateTimer(int timer);

signals:
    void updatetime(int);
    void timeout();

public slots:
    void on_start(bool start);
    void on_reset();

private:
    QHBoxLayout *m_pRootLayout;
    QLabel *m_pTimeLabel;
    QLabel *m_pColon_0;
    QLabel *m_pMinuteLabel;
    QLabel *m_pColon_1;
    QLabel *m_pSecondLabel;

    int m_iSumTime;
    int m_iTime;
    int m_iMinute;
    int m_iSecond;

    QTimer *m_pTimer;

};

#endif // THETIMINGWIDGET_H
